﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Mirkuz.UI
{
    public partial class TForm : Form
    {
        Image _background;
 
        public TForm()
        {
            _background = null;
        }
      
        public Image BackgroundImage
        {
            get{
                return _background;
            }
            set {
                _background = value;      
                this.Invalidate();
            }
        }

        protected override void OnPaint(PaintEventArgs e)
        {
            if (_background==null)
                return;

            Rectangle dst=new Rectangle(0,0,Width,Height);
            Rectangle src=new Rectangle(0,0,_background.Width,_background.Height);
            
            e.Graphics.DrawImage(_background,dst,src, GraphicsUnit.Pixel);            
        }
    }
}